using Godot;
using System;
using System.Collections.Generic;
using System.Linq; 


public partial class BtFightSelector : BTSelector//是否进入战斗的选择节点
{
	public override double Utility()
    {
		Characters parentOfType = FindParentOfType<Characters>(this);
		_character = parentOfType;
		double value = 0.0;
		if((_character.CharacterData as EnemyData).hate >0)
		{value = 0.6;}
		if(_character is scp173&&(_character as scp173).sightFrom.Count != 0)
        {
			value = 0;
        }
		return value;
    }
	public override void On_child_completed(bool result)
	{
		Characters parentOfType = FindParentOfType<Characters>(this);
		_character = parentOfType;

		if(result)
		{EmitSignal(SignalName.completed,succeed());return;}
		EmitSignal(SignalName.completed,faile());
		
	}


	
}
